package com.qf.quartz.job;

import org.quartz.*;

/**
 * @author 王博康
 * @version 1.0
 * @project 08_quartz
 * @description: TODO
 * @date 2022/3/12 15:58 星期六
 */
public class MyJob implements Job {
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        //可以从参数中获取加载任务时放入的数据
        JobDetail jobDetail = jobExecutionContext.getJobDetail();
        JobDataMap jobDataMap = jobDetail.getJobDataMap();
        String name = jobDataMap.getString("name");
        String age = jobDataMap.getString("age");

        System.err.println(name+":"+age+"---"+"MyJob类的execute方法执行了..."+System.currentTimeMillis());
    }
}
